package com.ocom.company.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ocom.common.entity.human.EntityResourceApi;
import com.ocom.common.enums.DataSourceEnum;
import com.ocom.common.enums.MasterSlaveEnum;
import com.ocom.company.dao.IDaoResourceApi;
import com.ocom.company.service.ResourceApiService;
import com.ocom.mysql.aspect.DataSourceAspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class ResourceApiServiceImpl extends ServiceImpl<IDaoResourceApi, EntityResourceApi> implements ResourceApiService {


    @Autowired
    private IDaoResourceApi iDaoResourceApi;

    @DataSourceAspect(type= DataSourceEnum.MAIN_DB,isMaster = MasterSlaveEnum.SLAVE)
    @Override
    public List<EntityResourceApi> getPageList(Integer role) {
        return iDaoResourceApi.getPageList(role);
    }

    @DataSourceAspect(type= DataSourceEnum.MAIN_DB,isMaster = MasterSlaveEnum.SLAVE)
    @Override
    public List<EntityResourceApi> getButtoneList(Integer role) {
        return iDaoResourceApi.getButtoneList(role);
    }
}
